import type { userGetuserInfoReturnModel } from "@/api/modules/user";
import { userGetuserInfo } from "@/api/modules/user";
// 获取用户信息接口
export function getUserInfo(): Promise<userGetuserInfoReturnModel> {
	return new Promise(resolve => {
		userGetuserInfo()
			.then(({ code, data }) => {
				if (code === 0) {
					resolve(data);
				} else {
					resolve({} as userGetuserInfoReturnModel);
				}
			})
			.catch(() => {
				resolve({} as userGetuserInfoReturnModel);
			});
	});
}
